package org.lex.ftp.ui.actions;

import java.awt.event.ActionEvent;

import org.lex.ftp.FTP;
import org.lex.ftp.net.find.FTPFileNode;
import org.lex.ftp.ui.calculator.CalculateDialog;
import org.lex.utils.tree.DFS;


public class CalculateSizeAction extends FTPAction {
	public CalculateSizeAction(FTP app) {
		super(app);
		this.setName("Calculate Size...");
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		new CalculateDialog(app).setVisible(true);
		// IFTPFile root = FTPFile.newFile( "/", "", true );
		// String bakPwd = root.getFullPath();
		// FTPFileNode node = new FTPFileNode(
		// app.getFTPExplorer().getFTPClient(), root );
		// dfs( new DFS( node ) );
		// app.getFTPExplorer().getFTPModel().setCatalog( bakPwd );
	}

	void dfs(DFS dfs) {
		while (dfs.hasNext())
			System.out.println(((FTPFileNode) dfs.next()).getData().getFullPath());
	}
}
